using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RecoilForceEffect : LogicalEffectBase
{
    RecoilForceEffectData data;
    public override void Init(GameObject originalGameObject, object[] args = null)
    {
        base.Init(originalGameObject, args);
        data = effectData as RecoilForceEffectData;
    }
    public override void OnApply()
    {
        Rigidbody2D rb2D = originalGameObject.GetComponent<Rigidbody2D>();
        if (rb2D != null)
        {
            rb2D.AddRelativeForce(-transform.right * data.recoilForce, ForceMode2D.Impulse);
        }
    }
    public override bool GetLifeState()
    {
        return false;
    }
}
